define(['jquery', 'api', 'user', 'util'], function($, api, user, util) {
    var vm,
            controller = {
                init: function(id) {
                	api.headerShow(1);
					api.headerTitle(L('html_title_user_risk'));
					api.headerLeftLink('#/user/register/risk');
                    api.footerShow(0);
                    api.setTitle(L('html_title_user_risk'));
                    this.render();
                },
                render: function() {
                    var that = this;
                    $('#common').html('<div id="risk"></div>');
                    require(['text!pages/user/risk.html', 'Vue'], function(tpl, Vue) {
                        vm = new Vue({
                            el: '#risk',
                            data: {
                                show: true,
                                risk: {'content': ''}
                            },
                            template: tpl
                        });

                        that.loadRule();
                    });
                },
                loadRule: function() {
                    api.articleList({count: 1, typeid: 4}, function(rs) {
                        if (rs.retcode == 0 && rs.data) {
                            if (typeof rs.data == 'object') {
                                vm.risk = rs.data[0];
                            }
                        }
                    })
                },
                onRouteChange: function() {
                    if (vm)
                        vm.show = false;
                }
            }
    return controller;
})